NS=liblsheeps.a
INC= -I ../framework -I ../third -I ../lua -I ../lua_3rd -I ../zlib
LIB=

OBJ= LuaProtocol.o lsheeps.o luavms.o lsheepsrun.o

CC=gcc
CXX=g++ -std=c++11
TARGET=$(NS)
DEFINE=-D_GNU_SOURCE -D_REENTRANT
CFLAGS=-g -O2 -pipe -Wall -fno-strict-aliasing -Wno-sizeof-pointer-memaccess -fPIC
CFLAGS+=$(DEFINE)

all:
	make build OUT_CONFIG=-D_DEBUG

release:
	make build OUT_CONFIG=-DNDEBUG

build: $(TARGET)

$(TARGET):$(OBJ)
	ar rcs $(TARGET) $(OBJ)
%.o: %.cpp
	$(CXX) $(CFLAGS) $(OUT_CONFIG) $(INC) -c $<
%.o: %.c
	$(CC) $(CFLAGS) $(OUT_CONFIG) $(INC) -c $<
clean:
	rm -f $(OBJ)
	rm -f $(TARGET)
